//
//  CHAppConfiger.h
//  QiHua
//
//  Created by pzdf on 15/3/24.
//  Copyright (c) 2015年 pzdf. All rights reserved.
//

#ifndef CHAppConfiger_h
#define CHAppConfiger_h


#define kCarpoolingUrl       @"http://116.62.193.227/app-server/app-web/index.html"
/**
 宏定义
 */
#define kApplication         ([UIApplication sharedApplication])
#define kAppKeyWinodw         ([UIApplication sharedApplication].keyWindow)
#define kAppDelegate         ((AppDelegate*)MyApplication.delegate)
#define kUserDefaults           [NSUserDefaults standardUserDefaults]
#define kNotificationCenter     [NSNotificationCenter defaultCenter]
#define kDefalutUserHeader      [UIImage imageNamed:@"gohelp_pep_icon.png"]
#define defalutImage [UIImage imageNamed:@"图片加载"]
#define weakSelf(weakSelf) __weak typeof(self)weakSelf = self;
#define strongSelf(strongSelf) __strong typeof(weakSelf)strongSelf = weakSelf; if (!strongSelf) return;
#define DERetCode  [responseObject[@"retCode"] integerValue] == 0
/*
 登录状态
 */
#define LoginStatus @"LoginStatus"
//device
#define kSystemVersion [[[UIDevice currentDevice] systemVersion] floatValue]
#define UIImageFromFile(imageName) [UIImage imageWithContentsOfFile:ImageBundle(imageName)]
//NaviBarHeight

//#define NAVH (MAX(Device_Width, Device_Height)  == 812 ? 88 : 64)
//#define TabBarHeight (MAX(Device_Width, Device_Height)  == 812 ?83.0f: 49.0f)
// Tabbar安全区域底部间隙
#define TabbarSafeBottomMargin  (MAX(Device_Width, Device_Height)  == 812 ? 34.f : 0.f)


#define NAVH ((DEWScreenHeight == 812.0f) ? 88.0f:64.0f)

#define TabBarHeight ((DEWScreenHeight == 812.0f) ? 83.0f:49.0f)

//rgb颜色
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

#define UIColorFromRGBWithAlpha(rgbValue,a) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:a]

#define RGBA(r,g,b,a)       [UIColor colorWithRed:((r)/255.0) green:((g)/255.0) blue:((b)/255.0) alpha:(a)]
// 颜色
#define kNavgationBarColor      UIColorFromRGB(0xF8F8F8)
#define kAppBaseBackgroundColor UIColorFromRGB(0xf2f2f2)
#define kAppBaseLineColor       UIColorFromRGB(0xd6d6d6)
#define kAppBaseButtonColor     UIColorFromRGB(0x4fccad)
#define KAppDefaultColor        UIColorFromRGB(0xFF8900)

///红点color
#define PointColor UIColorFromRGB(0xFF492C)
///消息cell分割线color
#define CellLineColor UIColorFromRGB(0xDCDCDC)
///字体颜色
#define Color_33 UIColorFromRGB(0x333333)
#define Color_99 UIColorFromRGB(0x999999)
#define Color_66 UIColorFromRGB(0x666666)
#define BGVColor UIColorFromRGB(0xf5f5f5)


#define Device_Width DEWScreenWidth

#define Device_Height DEWScreenHeight

//适配
#define     WideProportion             (Device_Width / (750.0 / 2.0))
#define     HighProportion             (Device_Height / (1334.0 / 2.0))
#define     kAdjustHeight(h)           (h * (HighProportion))
#define     kAdjustWidth(w)            (w * (WideProportion))
//以6为基准
#define ZYScaleW(value) ((value)/375.0f*[UIScreen mainScreen].bounds.size.width) ///<屏幕以6s为准
#define ZYScaleH(value) ((value)/667.0f*[UIScreen mainScreen].bounds.size.height) ///<屏幕以6s为准

///边距
#define Margin_15 15.0f
#define Margin_10 10.0f

/***  当前屏幕宽度 */
#define DEWScreenWidth  [[UIScreen mainScreen] bounds].size.width
/***  当前屏幕高度 */
#define DEWScreenHeight  [[UIScreen mainScreen] bounds].size.height

#endif
